package com.quoo.struts2.service.impl;

import java.util.List;

import com.quoo.struts2.dao.UserDAO;
import com.quoo.struts2.domain.User;
import com.quoo.struts2.service.UserService;





public class UserServiceImpl implements UserService {

	private UserDAO userDao;

	public UserDAO getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDAO userDao) {
		this.userDao = userDao;
	}

	public List<User> findAll() {

		return this.userDao.findAllUsers();
	}

	public void Save(User user) {
		this.userDao.saveUser(user);
	}

	public void delete(User user) {
		this.userDao.removeUser(user);

	}

	public User findById(Integer id) {

		return this.userDao.findUserById(id);
	}

	public void update(User user) {
		this.userDao.updateUser(user);

	}

	@Override
	public boolean validate(String username, String password) {
		
		return this.userDao.validate(username, password);
	}
}
